Skip to content

Allow using __d() in plugin context.#1039

Merged
markstory merged 5 commits into3.nextfrom
3.next-plugin-domain
Oct 6, 2025
Merged

Allow using __d() in plugin context.#1039
markstory merged 5 commits into3.nextfrom
3.next-plugin-domain

Conversation

@dereuromark
Copy link
Copy Markdown
Member

@dereuromark dereuromark commented Jun 7, 2025

Possible soution to #1038

I wonder if we could make a helper wrapper for translations, to keep the templates more readable?

@LordSimal
Copy link
Copy Markdown
Contributor

The base idea is pretty cool, but I don't see any reason why one should use __() inside a plugin (so what we currently have 😁)

I'd rather always default to __d() if -p aka a Plugin file is being generated.

@dereuromark
Copy link
Copy Markdown
Member Author

That would simplify it a bit I guess :)

$plugin = $this->plugin;
if ($plugin) {
$plugin .= '.';
$pluginPath = $plugin;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the process of simplifying I also found a bug: A dot added to plugin is passed along to the templates.
This is now also fixed as a side effect.

# Conflicts:
#	templates/bake/Template/view.twig
@dereuromark dereuromark requested a review from markstory October 1, 2025 11:55
@markstory markstory merged commit 02a43ee into 3.next Oct 6, 2025
9 checks passed
@markstory markstory deleted the 3.next-plugin-domain branch October 6, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants